<?PHP
function class_name($obj)
{
	$strObj = explode(' ', print_r($obj, true));
 
	return $strObj[0];
}

class Application
{
	static function Run($form)
	{
		$form->Init();

		$form->Draw();
	}
}

class Form
{
	public $title = 'Form';

	public function __construct()
	{
		$this->title = class_name($this);
		$this->params = &$_REQUEST;
	}

	public function Init()
	{
	}

	public function Draw()
	{
		$viewFileName = 'View' . class_name($this) . '.php';
		extract((Array) $this);

		include ($viewFileName);
	}
}
?>
